<template>
  <div id="partnerlist"> 


          <el-table :data="datalist" style="width: 100%" :height="dtheight" :header-cell-style="{background:'#4F81BC',color:'white'}"
           :row-class-name="tableRowClassName"  :border="true">

                 <el-table-column label="申请时间"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.createtime }}</span>
                    </template>
                </el-table-column>
                 <el-table-column label="账号"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.utelphone }}</span>
                    </template>
                </el-table-column>
                 <el-table-column label="账号姓名"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.nickname }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="申请类别"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.type }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="申请人"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.name }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="联系方式"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.telphone }}</span>
                    </template>
                </el-table-column>
                 <el-table-column label="团队玩家预期"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.plan_number }}</span>
                    </template>
                </el-table-column>

         
                 <el-table-column label="操作" align='center' width="170px">
                    <template slot-scope="scope">
                        <el-button size="mini"  type="primary" class="button_class1" v-if="scope.row.status == 1"  plain>已同意</el-button> 
                        <el-button size="mini"  type="primary" class="button_class1" v-if="scope.row.status == 2"  plain>已拒绝</el-button> 
                        <el-button size="mini"  type="primary" class="button_class1" v-if="scope.row.status == 0"  plain @click="agree_but(scope.row)">同意</el-button> 
                        <el-button size="mini"  type="primary" class="button_class2"  v-if="scope.row.status == 0"  plain @click="refuse_but(scope.row)">拒绝</el-button> 
                    </template>
                </el-table-column>
  
            </el-table>  

   </div>
</template>

<script>

export default {
   name: 'partnerlist',
   props:{
      datalist:{  
        //type:Array,
       default:()=>[]
     },
  },
  data () {
    return {
        dtheight:'500',  //窗口高度
    }
  },
   components:{

  },
  created(){
     this.dtheight = window.innerHeight - 263
      
  },
  mounted (){
    
  },
  methods: {
    
    agree_but(row){

         this.$confirm('同意解冻, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {

              this.post("/partner_apply/agree", {
                id:row.id,
              }).then(res => {
                if(res.error_code == 0){
                    this.open1(res.result,'success')  //提示框
                    this.$emit('up_list_fun')
                }else {
                this.open1(res.message,'warning')
                }

            })

        })

        
    },

    refuse_but(row){

         this.$confirm('拒绝解冻, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {

              this.post("/partner_apply/refuse", {
                id:row.id,
              }).then(res => {
                if(res.error_code == 0){
                    this.open1(res.result,'success')  //提示框
                    this.$emit('up_list_fun')
                }else {
                this.open1(res.message,'warning')
                }

            })

        })

        
    },

  }
}
</script>


<style scoped>
.imga>>>.el-icon-circle-close {
      color: white;
    }

</style>